/* =========================================
   I. RÉGLAGES GÉNÉRAUX
========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 30px;
}

body {
    font-family: Arial, sans-serif;
    color: #263247;
    background-color: #f5f8f4;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

/* =========================================
   II. EN-TÊTE ET NAVIGATION
========================================= */

.entete {
    width: 100%;
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background-color: #c2e091;
    border-bottom: 1px solid #e7ebf0;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo_site {
    width: 165px;
    height: 60px;
    object-fit: contain;
}

.nav_links ul {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.link {
    display: inline-block;
    color: #263247;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.link:hover,
.link.active {
    color: #176b38;
}


/* =========================================
   III. BANNIÈRE DE PRÉSENTATION
========================================= */

.banniere {
    padding: 75px 8%;
    text-align: center;
    color: white;
    background:
        linear-gradient(rgba(12, 54, 32, 0.88),
            rgba(23, 107, 56, 0.88));
}

.surtitre {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #c2e091;
}

.banniere h1 {
    margin-bottom: 18px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.2;
}

.banniere>p:not(.surtitre) {
    max-width: 720px;
    margin: 0 auto 25px;
    font-size: 17px;
    color: #edf5e9;
}

.bouton-retour {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid #c2e091;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    transition: background-color 0.3s ease,
        color 0.3s ease;
}

.bouton-retour:hover {
    color: #173d27;
    background-color: #c2e091;
}


/* =========================================
   IV. CONTENU PRINCIPAL
========================================= */

.contenu-modules {
    width: 90%;
    max-width: 1200px;
    margin: 55px auto;
}

.introduction {
    margin-bottom: 35px;
    text-align: center;
}

.introduction h2 {
    margin-bottom: 12px;
    font-size: 30px;
    color: #176b38;
}

.introduction p {
    max-width: 750px;
    margin: 0 auto;
    color: #687386;
}


/* =========================================
   V. BLOCS DES DOMAINES
========================================= */

.domaine {
    margin-bottom: 45px;
    padding: 30px;
    background-color: white;
    border: 1px solid #e1e9df;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(30, 60, 40, 0.05);
    scroll-margin-top: 25px;
}

/*
   Si l'URL contient #domaine-I, #domaine-II, etc.,
   seul le domaine sélectionné est affiché.
   Sans ancre, tous les domaines restent visibles.
*/

body:has(.domaine:target) .domaine {
    display: none;
}

body:has(.domaine:target) .domaine:target {
    display: block;
}


/* =========================================
   VI. EN-TÊTE DE CHAQUE DOMAINE
========================================= */

.entete-domaine {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e7ebf0;
}

.numero-domaine {
    min-width: 65px;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background-color: #eaf5dd;
    color: #176b38;
    font-size: 23px;
    font-weight: bold;
}

.categorie {
    margin-bottom: 4px;
    color: #648b45;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.entete-domaine h2 {
    color: #203b2b;
    font-size: 23px;
    line-height: 1.4;
}

.nombre-modules {
    margin-top: 6px;
    color: #778274;
    font-size: 13px;
}


/* =========================================
   VII. GRILLE DES CARTES DE MODULES
========================================= */

.grille-modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.carte-module {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 190px;
    padding: 22px;
    background-color: #fbfcfa;
    border: 1px solid #e4ebdf;
    border-radius: 10px;
    transition: transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.carte-module:hover {
    transform: translateY(-4px);
    border-color: #a7cd82;
    box-shadow: 0 8px 22px rgba(23, 107, 56, 0.09);
}

.numero-module {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 5px;
    background-color: #eaf5dd;
    color: #176b38;
    font-size: 12px;
    font-weight: bold;
}

.carte-module h3 {
    margin-bottom: 20px;
    color: #263247;
    font-size: 16px;
    line-height: 1.5;
}

.carte-module a {
    margin-top: auto;
    color: #176b38;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.carte-module a:hover {
    color: #0c3f21;
    text-decoration: underline;
}


/* =========================================
   VIII. PIED DE PAGE
========================================= */

.pied-page {
    padding: 25px 5%;
    background-color: #173d27;
    color: #e8f1e5;
    text-align: center;
    font-size: 14px;
}


/* =========================================
   IX. ADAPTATION AUX TABLETTES
========================================= */

@media screen and (max-width: 950px) {

    .grille-modules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contenu-modules {
        width: 94%;
    }

    .domaine {
        padding: 24px;
    }

}


/* =========================================
   X. ADAPTATION AUX TÉLÉPHONES
========================================= */

@media screen and (max-width: 650px) {

    .entete {
        flex-direction: column;
        gap: 15px;
        padding: 15px 4%;
    }

    .logo_site {
        width: 145px;
        height: 50px;
    }

    .nav_links {
        width: 100%;
    }

    .nav_links ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px 22px;
    }

    .link {
        font-size: 14px;
    }

    .banniere {
        padding: 55px 6%;
    }

    .banniere>p:not(.surtitre) {
        font-size: 15px;
    }

    .contenu-modules {
        width: 92%;
        margin: 35px auto;
    }

    .introduction h2 {
        font-size: 25px;
    }

    .domaine {
        padding: 18px;
        margin-bottom: 25px;
    }

    .entete-domaine {
        align-items: flex-start;
        gap: 13px;
    }

    .numero-domaine {
        min-width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .entete-domaine h2 {
        font-size: 19px;
    }

    .grille-modules {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .carte-module {
        min-height: 160px;
        padding: 18px;
    }

}
[hidden] { display: none !important; }